-- card: 13324 from stack: in.2r -- bmap block id: 0 -- flags: 4000 -- background id: 13187 -- name: Scroll Text Button 1 ----- HyperTalk script ----- on closecard put empty into card field result pass closecard end closecard -- part 6 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=68 top=308 right=325 bottom=212 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Result -- part 7 (field) -- low flags: 00 -- high flags: 4007 -- rect: left=57 top=70 right=299 bottom=491 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: description ----- HyperTalk script ----- -- -- Field script to allow special handling of option-clicked -- words in ANY text field, whether locked or unlocked -- -- Guy Kuo, University of Nevada School of Medicine -- December 13, 1987 -- -- Use this script freely in your owns stacks but please retain the -- credit line -- On MouseWithin -- UNSOM technique by Guy Kuo, December 13, 1987 -- If the the option key is depressed, set the cursor to indicate -- we are in a special mode. While the option key continues to be -- depressed, and the mouse is within the target field, wait for -- mouseDowns. If one occurs, Pick up the word by clicking at the -- last MouseLoc twice and getting the selection. -- If the selection is not empty, do something with it. In this demo, -- we put it into another field. Finally, click outside of the field -- to avoid looping. Hopefully, (-1,-1) is outside of all active -- objects. -- -- While editing such a field, entry of Optioned characters from -- the keyboard no longer requires movement of the mouse outside of -- the field. However, the optioned characters do not appear until -- after the option key is released if the OptionKey is down then if the locktext of the target is true then put true into DidUnlock set locktext of target to false else put false into DidUnlock end if set the cursor to 2 repeat while (the OptionKey is down) and (item 1 of the rect of target <= item 1 of the mouseLoc) and (item 1 of the mouseLoc <= item 3 of the rect of target) and (item 2 of the rect of target <= item 2 of the mouseLoc) and (item 2 of the mouseLoc <= item 4 of the rect of target) if the Mouse is down then click at the MouseLoc click at the ClickLoc if the selection <> empty then put the selection into card field "result" -- or do something useful with it end if click at -1,-1 end if end repeat if DidUnlock then set the locktext of the target to true end if end if end MouseWithin -- part contents for background part 4 ----- text ----- 1 -- part contents for background part 2 ----- text ----- Scrolling Text Button 1 -- part contents for card part 7 ----- text ----- OPTION CLICK on any word in this field for an example of how this script works. -- -- Field script to allow special handling of option-clicked -- words in ANY text field, whether locked or unlocked -- -- Guy Kuo, University of Nevada School of Medicine -- December 13, 1987 -- -- Use this script freely in your owns stacks but please retain the -- credit line -- On MouseWithin -- UNSOM technique by Guy Kuo, December 13, 1987 -- If the the option key is depressed, set the cursor to indicate -- we are in a special mode. While the option key continues to be -- depressed, and the mouse is within the target field, wait for -- mouseDowns. If one occurs, Pick up the word by clicking at the -- last MouseLoc twice and getting the selection. -- If the selection is not empty, do something with it. In this demo, -- we put it into another field. Finally, click outside of the field -- to avoid looping. Hopefully, (-1,-1) is outside of all active -- objects. -- -- While editing such a field, entry of Optioned characters from -- the keyboard no longer requires movement of the mouse outside of -- the field. However, the optioned characters do not appear until -- after the option key is released if the OptionKey is down then if the locktext of the target is true then put true into DidUnlock set locktext of target to false else put false into DidUnlock end if set the cursor to 2 repeat while (the OptionKey is down) and¬ (item 1 of the rect of target <= item 1 of the mouseLoc) and¬ (item 1 of the mouseLoc <= item 3 of the rect of target) and¬ (item 2 of the rect of target <= item 2 of the mouseLoc) and¬ (item 2 of the mouseLoc <= item 4 of the rect of target) if the Mouse is down then click at the MouseLoc click at the ClickLoc if the selection <> empty then -- --the selected word is now in 'selection'. It's up to you to do something with it. -- end if click at -1,-1 end if end repeat if DidUnlock then set the locktext of the target to true end if end if end MouseWithin